from django.shortcuts import render

# Create your views here.
from .serializers import BannerModelSerializer,NavModelSerializer
from .models import Banner,Nav
from rest_framework.generics import ListAPIView

class BannerListAPIView(ListAPIView):
    queryset = Banner.objects.filter(is_delete=False,is_show=True)
    serializer_class = BannerModelSerializer


class NavHeaderListAPIView(ListAPIView):
    """头部导航"""
    queryset = Nav.objects.filter(is_show=True, is_delete=False, opt=0).order_by("-orders","-id")
    serializer_class = NavModelSerializer


class NavFooterListAPIView(ListAPIView):
    """脚部导航"""
    queryset = Nav.objects.filter(is_show=True, is_delete=False, opt=1).order_by("-orders","-id")
    serializer_class = NavModelSerializer